import React, {PropTypes} from 'react'
import {connect} from 'dva'
import { routerRedux } from 'dva/router';
import { Menu, Icon, Layout } from 'antd'
import Sider from '../components/layout/sider'
import Header from '../components/layout/header'
import {NewDataMenu} from '../components/cor'

function App({children, location, dispatch, app,}) {
  const { muensData, firstMuens} = app;

  const siderProps = {
    location,
    muensData
  };
  const headerProps = {
    location,
    firstMuens,
    dispatch
  };

  return (
    <div style={{height: '100%'}}>
      <Layout className="ant-layout-has-sider" style={{height: '100%'}}>
        <Sider {...siderProps} />
        <Layout>
          <Header {...headerProps}></Header>
          <div style={{overflowY:'auto', overflowX:'hidden', height: '150%'}}>
            <div style={{ margin: '24px 16px' }}>
              {children}
            </div>
          </div>
        </Layout>
      </Layout>

    </div>
  )
}
App.propTypes = {
  children: PropTypes.element.isRequired,
  location: PropTypes.object,
  dispatch: PropTypes.func,
  app: PropTypes.object,
};
export default connect(({app}) => ({app}))(App)
